Chromatin Immunoprecipitation Sequencing    ◾    237

protein studied. The “plotDistToTSS()” function creates a plot showing the distribution of

the peaks relative to the TSS.

plotDistToTSS(annotated_peaks,

title=”Distribution of Poly II relative to TSS”)

As shown in Figure 6.15, most interaction sites are in the region of 0–1 kb from the TSS of

the genes.

6.3.7.1  Writing Annotations to Files

The annotation information of the peaks can be written to a file so that it can be used for

further analysis. The annotation file will include chromosome name, start (peak start posi-

tion), end (peak end position), width (number of bases), strand, peak name, annotation

(gene region), gene chromosome, gene start, gene end, gene length (bases), gene strand,

gene Id, transcript Id, distance to TSS (in bases), and gene name. This information is usu-

ally used by researchers to investigate individual genes. The following R codes write the

annotations for the three ChIP-Seq samples to three text files: “Chip1_peak_annotation.

txt”, “Chip2_peak_annotation.txt”, and “Chip3_peak_annotation.txt”.

#Write Chip1 annotation to a file

#separet Chip1 annotation in a data frame

chip1_annot <- data.frame(annotated_peaks[[“chip1”]]@anno)

FIGURE 6.14  Bar chart of the genomic feature representation.